/**
 * Copyright 2012 Roger Cockshutt
 * krakenbrau@gmail.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.googlecode.libspml;

import java.util.List;

/**
 * @author Roger Cockshutt
 *
 * Subclasses of AbstractISyntaxTreeProvider build and provide ISyntaxTrees from Lists of ITokens.
 */
public interface ISemanticSyntaxTreeProvider {
	
	/**
	 * Accepts an (ordered) list of ITokens and returns an ISemanticSyntaxTree represting the semantic
	 * syntactic structure of the source code.
	 * 
	 * @param tokens ITokens to process.
	 * @return Tree representation of the syntax of the ITokens provided.
	 */
	public ISemanticSyntaxTree buildTree(List<AbstractToken> tokens);
	
	
	/**
	 * @author Roger Cockshutt
	 *
	 * Symbol types.
	 */
	public static enum SemanticSymbol {
		MODEL				(false),
		SCOPE_DEFINITION	(false),
		OBJECT_DEFINITION	(false),
		PROPERTY_DEFINITION (false),
		VALUE_DECLARATION	(false),
		IDENTIFIER			(true),
		DECLARATOR			(true),
		TERMINATOR			(true)
		;
		
		public final boolean _isTerminal;
		
		private SemanticSymbol(boolean terminal) {
			this._isTerminal = terminal;
		}
		
		public AbstractSemanticSyntaxNode makeNode(String value) {
			return new AbstractSemanticSyntaxNode(this, _isTerminal, value) {};
		}
	}
	

}
